#ifndef _KLAS_ENGINE_HPP_
#define _KLAS_ENGINE_HPP_

#include "../include/ParticleEngine.hpp"
#include "../include/PostProcessor.hpp"
#include "../include/Camera.hpp"
#include "../include/Scene.hpp"
#include "../include/Vector2.hpp"
#include "../include/Libs.hpp"
#include <string>
using namespace std;

namespace klas
{
	//! The engine interfaces different components together.
	class Engine
	{
		public:
		
			//! Creates the engine and also sets up the window.
			/*! \param windowDim The dimensions of the window to create. */
			Engine(const Vector2<Real>& windowDim);
			
			//! Dtor.  Deletes the camera, but lets the scene be.
			~Engine();
			
			//! Changes the current scene that the engine is using.
			/*! \param scene The new scene to use */
			void setScene(Scene* scene);
		
			//! Changes the current particle emitter that the engine is using.
			/*! \param engine The new particle engine to use. */
			void setParticleEngine(ParticleEngine* engine);
			
			//! Changes the post-processor
			/*! \param postProcessor The post processor to use.
					\param particles Should the particle engine be post-processed? */
			void setPostProcessor(PostProcessor* postProcessor, bool particles = false);
			
			//! Changes the caption of the window.
			/*! \param window The new title for the window.
					\param icon The title of the icon. */
			void setCaption(string window, string icon="USE_WINDOW__");
			
			//! Gets the box that represents the camera.
			/*! \return The camera's pointer. */
			Camera* getCamPtr();
			
			//! Render's the current scene.
			/*! \return False if there is no scene. */
			bool render();
			
			
		private:
			
			//! The camera pointer.
			Camera* m_cam;
			
			//! The current scene.
			Scene* m_scene;
			
			//! The current particle engine.
			ParticleEngine* m_particle;
			
			//! The current post processor.
			PostProcessor* m_postProcessor;
			
			//! Should particles be post-processed?
			bool m_postProcessParticles;
			
			//! Have external libraries been inited?
			static bool m_initExternal;
			
	};
}

#endif
